package com.example.test02;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class MainActivity extends AppCompatActivity {
    private EditText etName;
    private EditText etPwd;
    private Button btn1;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        etName = findViewById(R.id.etName);
        etPwd = findViewById(R.id.etPwd);
        btn1 = findViewById(R.id.btn1);
        btn1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                passDate();
            }
        });
    }

    private void passDate() {
        String name = etName.getText().toString().trim();
        String pwd = etPwd.getText().toString().trim();
        Intent intent = new Intent(this, HomeActivity.class);
        intent.putExtra("name",name);
        intent.putExtra("pwd",pwd);
        startActivity(intent);
    }
}